package com.caoji;

import com.caoji.client.ItemClient;
import com.caoji.entity.SpecParamDTO;
import com.caoji.serach.EsApplication;
import com.caoji.serach.service.EsService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

/**
 * @Description： User: caoji
 * Date: 2020/12/12
 * Time: 20:07
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = EsApplication.class)
public class caojitest {
    @Autowired
    EsService searchService;
    @Autowired
    private ItemClient client;

    @Test
    public void test (){
        List<SpecParamDTO> specParamDTOS = client.querySpecsValues(114L, true);
        specParamDTOS.forEach(System.out::println);
    }

    @Test
    public void  creat(){
        searchService.createIndexAndMapping();
    }
    @Test
    public void  hh(){
        searchService.loadData();
    }

}
